home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
LDB171.ARJ
/
EXAMP301.CPP
< prev
next >
Wrap
Text File
|
1992-05-12
|
856b
|
35 lines
// examp301.cpp - link with binder.obj
#include <string.h>
#include "binder.hpp"
char *v[] = {
"Vectors can be",
"'exploded' into Binders",
"sorted and then",
"'imploded' back to vectors!",
0
};
main()
{
Binder b ((voiDV) v); // explode constructor
cout << "\n\nExploded, unsorted vector ...\n\n";
for (unsigned i = 0; b[i]; i++)
cout << (char *) b[i] << "\n";
b.sort ((BDRcomP) strcmp); // sort
char **sV = (char **) b.vector(); // implode
if (!sV) return 1;
cout << "\n\nImploded, sorted vector ... \n\n";
for (i = 0; sV[i]; i++)
cout << sV[i] << "\n";
delete sV;
return 0;
}